#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<vector>

using namespace std;

bool canJump(vector<int>& nums) {
    int i, step = 1, n = nums.size();
    for (i = 0; i < n && step > 0; i++)
        step = max(step - 1, nums[i]);
    return i == n;
}